package com.lx.spring.config.filter;

import org.springframework.core.io.Resource;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.ClassMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.MetadataReaderFactory;
import org.springframework.core.type.filter.TypeFilter;

import java.io.IOException;

public class MyTypeFilter implements TypeFilter {

    public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException {


        AnnotationMetadata amd = metadataReader.getAnnotationMetadata();

        ClassMetadata cmd = metadataReader.getClassMetadata();

        Resource resource = metadataReader.getResource();

       String cn = cmd.getClassName();
       System.out.println(">>>>>>>>>>>> "+cn);

       if(cn.contains("DA")){
           return true;
       }

        return false;
    }
}
